package user

import (
	"go.uber.org/fx"
	"mallgo/core"
	"mallgo/internal/resources/user/resource"
)

func InitRouter(res *resource.UserResource, s *core.AppServer) {
	// 用户路由
	newUserController := NewUserController(res)
	s.Engine.POST("/register", newUserController.Register)
	s.Engine.POST("/login", newUserController.Login)

}

var Module = fx.Options(
	fx.Provide(
		resource.NewUserResource,
		NewUserController,
	),
	fx.Invoke(
		InitRouter,
	),
)
